#!/bin/bash

ANDROID_NDK_HOME=/d/Android/AndroidSDK/ndk/21.1.6352462
CMAKE_ANDROID=/d/Android/AndroidSDK/cmake/3.10.2.4988404/bin/cmake

#在Windows上编译时需要在${CMAKE_ANDROID}后面加上选项 -G "Unix Makefiles"
#否则会报错CMAKE_SYSTEM_NAME is 'Android' but 'NVIDIA Nsight Tegra Visual Studio Edition' is not installed.

${CMAKE_ANDROID} -G "Unix Makefiles" -DCMAKE_BUILD_TARGET=ndk -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
      -DANDROID_NDK=$ANDROID_NDK_HOME \
      -DANDROID_ABI=armeabi-v7a \
      -DANDROID_TOOLCHAIN=clang \
      -DANDROID_PLATFORM=android-27 \
      -DANDROID_STL=c++_shared \
	  ..
make
